mobileControlCreate
Type
command
Summary
Creates a native iOS or Android control.
Syntax
mobileControlCreate <controlType> [, <controlName> ]
Description
Low-level support has been added for creating and manipulating some native mobile controls (views) on iOS and Android.
Native mobile iOS and Android controllers can only be created dynamically in script.
To destroy a native control use: mobileControlDelete
To configure a native control use: mobileControlSet
To read a property of a native control use: mobileControlGet
To control the behavior of a native control use: mobileControlDo
If a player is created with an invalid filename or if the file is missing, the video controller will display incorrectly. To check if a player is set up correctly, the following code could be used:
if mobileControlGet(sPlayerID, \"duration\") < 0 then
answer \"Player is not initialised correctly\"
end if
Parameters
Name | Type | Description |
---|---|---|
controlType | enum | The type of control to create. |
controlName | Optional string to use to identify the control. The controlName must be unique amongst all existing controls and cannot be an integer. |
Examples
mobileControlCreate "browser"
mobileControlCreate "scroller", "myFirstScroller"
put "input" into tControlType
mobileControlCreate tControlType, "myFirstInputField"
mobileControlCreate "player", "myFirstPlayer"
mobileControlSet "myFirstPlayer", "visible", true
mobileControlSet "myFirstPlayer", "rect", "50,50,500,500"
mobileControlSet "myFirstPlayer", "filename", specialFolderPath("engine") \
& "/movie.mp4"
mobileControlDo "myFirstPlayer", "play"
mobileControlCreate "multiline", "myMultiLineTextInput"
Related
command: mobileControlDelete, mobileControlDo, mobileControlSet
function: mobileControlGet, mobileControlTarget, result, mobileControls
Compatibility and Support
Introduced
LiveCode 4.6
OS
ios
android
Platforms
mobile